﻿
@model IEnumerable<YTCMS.Domain.Entities.products>
@using YTCMS.Core;

<table id="sample-table-1" class="table table-striped table-bordered table-hover">
    <thead>
        <tr>
            <th class="center">
                <label>
                    <input type="checkbox" class="ace" />
                    <span class="lbl"></span>
                </label>
            </th>
            <th>商品名称</th>
            <th>商品分类</th>
            <th>商品价(￥)</th>

            <th>库存</th>
            <th>是否推荐</th>
            <th>状态</th>
            <th></th>
        </tr>
    </thead>

    <tbody>
        @if (Model.Any())
        {
            foreach (var item in Model)
            {
                <tr>
                    <td class="center">
                        <label>
                            <input type="checkbox" class="ace" />
                            <span class="lbl"></span>
                        </label>
                    </td>
                    <td title="@item.Name">@item.Name.GetSubString(15, "")</td>
                    <td>
                        @item.category.ExtendFile("Name")
                    </td>
                    <td>@item.Price</td>

                    <td>@item.Stock</td>
                    <td>@item.IsPush.ToString().Replace("1", "推荐").Replace("0", "未推荐")</td>
                    <td>@Enum.GetName(typeof(YTCMS.Core.CommonState), item.State)</td>
                    <td>
                        <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                            <a class="btn btn-xs btn-info" href="/Product/Edit?Id=@item.Id">
                                <i class="icon-edit bigger-120"></i>修改
                            </a>

                            <a class="btn btn-xs btn-danger" href="javascript:void(0)" onclick="WZTDelete('/Product/Delete', {id:@item.Id})">
                                <i class="icon-trash bigger-120"></i>删除
                            </a>
                        </div>
                    </td>
                </tr>
            }
        }
    </tbody>
</table>
@Html.AjaxPager((int)ViewBag.PageSize, (int)ViewBag.TotalCount)

